
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package LiveReservations.control;

import static LiveReservations.control.action.EActionState.RESERVATION;
import LiveReservations.control.action.IAction;
import LiveReservations.control.action.LoginAction;
import LiveReservations.control.action.RegisterBusinessAction;
import LiveReservations.control.action.ReservationAction;
import LiveReservations.control.info.IInformation;
import LiveReservations.control.action.SearchBusinessAction;
import LiveReservations.control.action.RegisterClientAction;

/**
 *
 * @author grigo_000
 */
public class ClientManager {

    IAction currAction;

    void Update(IInformation info) {
        switch (info.getActionState())
        {
            case RESERVATION:
                currAction = new ReservationAction();
                break;
            case REGISTER_BUSINESS:
                currAction = new RegisterBusinessAction();
            case LOGIN:
                currAction = new LoginAction();
                break;
            case SEARCH_BUSINESS:
                currAction = new SearchBusinessAction();
                break;
            case REGISTER_CLIENT:
                currAction = new RegisterClientAction();
                break;
            default:
                currAction = null;
        }
        currAction.execute(info);
    }

}
